#ifndef __KEY_TASK_H__
#define __KEY_TASK_H__

#include <stdint.h>

#define KEY_TASK_TICK 20U // 任务执行间隔
#define KEY_LONG_TIME (500U / 20U) // 按键长按检测时间 500ms

#define B1_DOWN (0x01U << 0U)
#define B2_DOWN (0x01U << 1U)
#define B3_DOWN (0x01U << 2U)
#define B4_DOWN (0x01U << 3U)

#define B1_UP (0x01U << 4U)
#define B2_UP (0x01U << 5U)
#define B3_UP (0x01U << 6U)
#define B4_UP (0x01U << 7U)

#define B1_LONG (0x01U << 8U)
#define B2_LONG (0x01U << 9U)
#define B3_LONG (0x01U << 10U)
#define B4_LONG (0x01U << 11U)

void Key_Task(void);
uint16_t Key_GetState(void);
void Key_ClearState(uint16_t evnet);

#endif //__KEY_TASK_H__
